package cn.tedu.api;

import java.util.Scanner;

/**
 * @author: Dsi
 * @date: 2021/11/12 17:29
 * @description:该类用于正则表达案例
 */
public class TestRegex {
    public static void main(String[] args) {
        String regex ="[0-9]{17}[0-9X]";
        System.out.println("请输入身份证");
        String input=new Scanner(System.in).nextLine();
        if (input.matches(regex)) {
            System.out.println("正确");
        }else System.out.println("错误");

    }
}
